﻿@inject HttpClient _httpClient;
@inject IMessageService _message
@inject NavigationManager _NavigationManager
@inject ModalService _modalService;
@using EmployeeLeaveSystem.Shared.Models
<h3>用户详细信息</h3>
<br />
<Descriptions Title="User Info" Bordered Layout="@DescriptionsLayout.Horizontal">
    <DescriptionsItem Title="姓名">@myInfo?.Name</DescriptionsItem>
    <DescriptionsItem Title="性别">@myInfo?.StaffSex</DescriptionsItem>
    <DescriptionsItem Title="电话">@myInfo?.Phone_Number</DescriptionsItem>
    <DescriptionsItem Title="国家">@myInfo?.Nation</DescriptionsItem>
    <DescriptionsItem Title="身份证">@myInfo?.ID_Card</DescriptionsItem>
    <DescriptionsItem Title="个性签名" Span="4">这个人很懒，还没有个性签名</DescriptionsItem>
    <DescriptionsItem Title="个人状态" Span="3">
        <Badge Status="processing" Text="@myInfo?.StaffState.ToString()"></Badge>
    </DescriptionsItem>
    <DescriptionsItem Title="所属部门信息">
        @myInfo?.Department?.Name
    </DescriptionsItem>
</Descriptions>
<br />
@code {
    public static int QueryId { get; set; }
    StaffInfo? myInfo { get; set; }
    protected override async Task OnInitializedAsync() {
        if (GobalManager.myInfo != null) Author.QueryId = GobalManager.myInfo.Id;
        myInfo = await _httpClient.GetFromJsonAsync<StaffInfo>($"/Main/GetStaffInfoById?id={QueryId}");
        await base.OnInitializedAsync();
    }
}
